package com.example.Laboratory.Mapper;

import com.example.Laboratory.Entity.Organization;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface OrganizationMapper {

    //添加图片地址
    @Insert("INSERT INTO organization (organization_address)VALUES(#{organization_address})")
    int addOrganization (String organization_address);

    //查找全表
    @Select("SELECT * FROM organization ")
    Organization researchOrganization ( );

    //查找条数
    @Select("SELECT COUNT(*) FROM organization")
    int researchOrganization2 ( );

    //根据id查找地址
    @Select("SELECT organization_address FROM organization WHERE organization_id=#{organization_id}")
    String researchOrganization1 (int organization_id);

    //根据id删除
    @Delete("DELETE FROM organization WHERE organization_id=#{organization_id}")
    int deleteOrganization (int organization_id);

    //更新图片
    @Update("UPDATE organization SET organization_address=#{organization_address} WHERE organization_id=#{organization_id}")
    int reviseOrganization(Organization O);
}
